<?php
	

jimport( 'joomla.application.component.view');

class NBEventMapsViewNBEventMapList extends JView
{
    function display($tpl = null)
    {
		$mainframe = &JFactory::getApplication(); 
		$option    = JRequest::getCMD('option'); 
		$Itemid    = JRequest::getInt('Itemid'); 

        $document   =& JFactory::getDocument();

        $params = clone($mainframe->getParams('com_nbeventmap'));

        
        $params->def('show_headings',           1);
        $params->def('filter',                  1);

        if($params->get('show_feed_link', 1) == 1)
        {
            $link   = '&format=feed&limitstart=';
            $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
            $document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs);
            $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
            $document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs);
        }

        $model      = &$this->getModel(); 
        $rows       = $model->getNBEventMapList();
       	$map        = $model->getView();
		$perso		= $model->getPersonnalisation();
		$row_dates = array();
		foreach ($rows as $row_date) {
			$row_dates[] = $row_date->start_dates;
		}
		$row_dates = array_unique($row_dates);
		
        $this->assignRef('map'          , $map );	        
        $this->assignRef('rows'         , $rows);
        $this->assignRef('perso'        , $perso);
        $this->assignRef('params'       , $params);
        $this->assignRef('row_dates'   , $row_dates );

        parent::display($tpl);
    }   
}
?>
